<?php
/**
 * @abstract: Show detail post's content
 * @author: HoanVX
 * @version $Id: single.php 83 2015-03-14 15:11:29Z voxuanhoan@gmail.com $
 */

// Category list
add_style ( 'css/single.css' );
add_script ( 'js/jssor.js' );
add_script ( 'js/jssor.slider.js' );
add_script ( "js/single.js" );
get_header ();

?>
<!-- header-section-ends -->
<!-- content-section-starts -->
<div class="content">
	<div class="container">
	<?php require_once 'page/commons/breadcrumb.php';?>
	<?php if(have_posts()): the_post();?>
		<div class="alert alert-success" role="alert"
			style="background: #5BBD50; color: #FFF; font-weight: bold;">
		<?php the_title();?>
		</div>
		<div class="col-md-8 wow fadeInRight" id="colLeft"
			data-wow-delay="0.4s">
			<!-- Jssor Slider Begin -->
			<!-- You can move inline styles to css file or css block. -->
			<div class="subject">
				<label>Tiêu đề</label><span><?php the_title();?></span>
			</div>
			<div id="slider1_container" style="width: 730px; height: 456px;">
				<!-- Loading Screen -->
				<div u="loading" style="position: absolute; top: 0px; left: 0px;">
					<div
						style="filter: alpha(opacity = 70); opacity: 0.7; position: absolute; display: block; background-color: #000000; top: 0px; left: 0px; width: 100%; height: 100%;">
					</div>
					<div class="loading" style="">
					</div>
				</div>

				<!-- Slides Container-->
				<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 730px; height: 356px; overflow: hidden;">
					<?php
					$imgURIs = ChotroiUtils::getAttachImage($post->ID);
					foreach ($imgURIs as $img) {
						$imgUri = ChotroiUtils::getUploadImageURI($img);
						if (strpos($imgUri, 'no_image.jpg') !== false) {
							continue;
						}
					echo "<div>
							<img u='image' src='$imgUri' />
							<img u='thumb' src='$imgUri' />
						</div>";
					}
					?>
					<!-- <div>
						<img u="image" src="../img/alila/02.jpg" />
						<img u="thumb" src="../img/alila/thumb-02.jpg" />
					</div> -->
				</div>

				<!-- Arrow Navigator Skin Begin -->
				<!-- Arrow Left -->
				<span u="arrowleft" class="jssora05l" style="width: 40px; height: 40px; top: 158px; left: 8px;"> </span>
				<!-- Arrow Right -->
				<span u="arrowright" class="jssora05r"
					style="width: 40px; height: 40px; top: 158px; right: 8px"> </span>
				<!-- Arrow Navigator Skin End -->

				<!-- Thumbnail Navigator Skin Begin -->
				<div u="thumbnavigator" class="jssort01"
					style="position: absolute; width: 730px; height: 100px; left: 0px; bottom: 0px;">
					<!-- Thumbnail Item Skin Begin -->
					<div u="slides" style="cursor: move;">
						<div u="prototype" class="p"
							style="position: absolute; width: 72px; height: 72px; top: 0; left: 0;">
							<div class=w>
								<div u="thumbnailtemplate"
									style="width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0;"></div>
							</div>
							<div class=c></div>
						</div>
					</div>
					<!-- Thumbnail Item Skin End -->
				</div>
				<!-- Thumbnail Navigator Skin End -->
			</div>
			<!-- Jssor Slider End -->
			<div>
				<table class="table table-hover">
					<tr>
						<th class="info">Nội dung tin đăng</th>
						<td><?php the_content();?></td>
					</tr>
					<tr>
						<th class="info">Khu vực đăng tin</th>
						<td><?php
							$city = get_post_meta($post->ID, CT_CITY, true);
							$districOfCity = CityEnum::getDistricts($city);
							echo ChotroiUtils::getValueByKey($districOfCity, get_post_meta($post->ID, CT_DISTRICT, true))." - ". ChotroiUtils::getValueByKey(CtEnum::$cities, $city);
						?>
						</td>
					</tr>
					<tr>
						<th class="info">Giá sản phẩm</th>
						<td><?php echo number_format(get_post_meta($post->ID, CT_PRICE, true));?> (đồng)</td>
					</tr>
					<tr>
						<th class="info">Ngày hết hạn</th>
						<td><?php echo get_post_meta($post->ID, CT_POST_END_DATE, true);?></td>
					</tr>
					<tr>
						<th class="info">Ghi chú</th>
						<td><?php echo get_post_meta($post->ID, CT_NOTE, true);?></td>
					</tr>
				</table>
			</div>
		</div>
		<div class="col-md-4  wow fadeInRight" id="colRight"
			data-wow-delay="0.4s">
			<div class="contact_box_v2">
				<div class="left_arrow1"></div>
				<div id="contact_seller_inline">
					<div id="contact_seller">Liên hệ</div>
					<a class="advertised_user" href="" onclick=""><?php echo get_the_author_meta( 'display_name', get_the_author_meta('ID') ); ?></a>
				</div>
				<!-- Phone author -->

				<div class="btn btn-info btn-contact">
					<a><span class="glyphicon glyphicon-phone"></span><?php the_author_meta('ct_phone');?></a>
				</div>
				<!-- End Phone author -->

				<!--contact via email -->
				<div class="btn btn-info btn-contact">
					<a class=""> <span class="glyphicon glyphicon-envelope"></span> <span
						style="vertical-align: middle;"><?php the_author_meta('user_email');?></span>
					</a>
					<div class="clear"></div>
				</div>
			</div>

			<div class="remember">
				<span class="vi_tips_title">MUA HÀNG AN TOÀN</span>
				<ul>
					<li><span class="sprite_common_bullet_check_red"></span>KHÔNG trả tiền trước khi nhận hàng.</li>
					<li><span class="sprite_common_bullet_check_red"></span>Kiểm tra hàng cẩn thận, đặc biệt với hàng đắt tiền.</li>
					<li><span class="sprite_common_bullet_check_red"></span>Hẹn gặp ở nơi công cộng.</li>
					<li><span class="sprite_common_bullet_check_red"></span>Nếu bạn mua hàng hiệu, hãy gặp mặt tại cửa hàng để nhờ xác minh, tránh mua phải hàng giả.</li>
				</ul>
				<span class="vi_tips_footer">Tìm hiểu thêm về <a onclick="" href="">An toàn mua bán</a>.</span>
</div>
		</div>
	<?php endif; ?>

		</div>
</div>
<?php get_footer('contact');?>
<?php


get_footer ();

?>